#! /bin/bash

cat > a.txt <<"EOF"
This is a very long line which is suposed to be as long as 75 characters and should be fmt.
This is a short line which is about 50 characters.
This is a very short line.
15 characters.

EOF

# fmt [options]... [file]...

# -s tells fmt to format only long lines (default 75 characters width).
echo "fmt -s a.txt"
fmt -s a.txt
echo ""

# -wn tells fmt to format with width 40 per line.
echo "fmt -w40 a.txt"
fmt -w40 a.txt
echo ""

# with width 30.
echo "fmt -w30 a.txt"
fmt -w30 a.txt
echo ""

rm a.txt
